﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using Zero.Common;

namespace Zero.Service
{
    /// <summary>
    /// WCF Channel.
    /// </summary>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public interface IServiceChannel : IService, IClientChannel
    {
    }

    /// <summary>
    /// WCF client.
    /// </summary>
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
    public partial class Client : ClientBase<IService>, IService
    {
        private readonly EndpointAddress _remoteAddress;

        /// <summary>
        /// </summary>
        public Client()
        {
        }

        /// <summary>
        /// </summary>
        public Client(string endpointConfigurationName) :
            base(endpointConfigurationName)
        {
        }

        /// <summary>
        /// </summary>
        public Client(string endpointConfigurationName, string remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
        {
        }

        /// <summary>
        /// </summary>
        public Client(string endpointConfigurationName, EndpointAddress remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
        {
            _remoteAddress = remoteAddress;
        }

        /// <summary>
        /// </summary>
        public Client(System.ServiceModel.Channels.Binding binding, EndpointAddress remoteAddress) :
            base(binding, remoteAddress)
        {
        }

        /// <summary>
        /// Implementation of <see cref="IService.ProcessObject"/>.
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public TransportObject ProcessObject(TransportObject request)
        {
            return base.Channel.ProcessObject(request);
        }
    }
}
